package com.qf.controller;

import com.qf.service.TypeService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 王希卓
 * @Date 2023/7/18 14:25
 * 课程分类
 */
@RestController
public class TypeController {

    @Autowired
    private TypeService typeService;

    /**
     * 查询所有分类
     * @return
     */
    @GetMapping("/type/findAll")
    public ResultMsg findAll(){
        return typeService.findAll();
    }

    /**
     * 根据课程分类查询其对应的所有课程
     * @param typeName
     * @return
     */
    @GetMapping("/type/findCoursesByTypeName")
    public ResultMsg findId(int page,int limit,String keyword,String typeName){
        return typeService.findCoursesByTypeName(page,limit,keyword,typeName);
    }
}
